package com.sunlands.qdcy.tongzhuo.repository;

import com.sunlands.qdcy.tongzhuo.model.UserDiaryTopicHistoryDO;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author shixiaopeng
 */

@Repository
public interface UserDiaryTopicHistoryRepository extends JpaRepository<UserDiaryTopicHistoryDO, Long>, JpaSpecificationExecutor<UserDiaryTopicHistoryDO> {

    List<UserDiaryTopicHistoryDO> findByUserIdAndIsDeleteOrderByUpdateTimeDesc(long userId, boolean isDelete);

    UserDiaryTopicHistoryDO findByUserIdAndTopicId(long userId, long topicId);

}
